﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Organization : Form
    {
        Form home = null;
        int checker = 0;
        string username = null;

        public Organization(Form _home,string _username)
        {
            home = _home;
            username = _username;
            InitializeComponent();
        }

        
        //Event after click the mail button
        private void org_mail_Click(object sender, EventArgs e)
        {
            message_org.Show();
        }
        //Event after click the createproject button
        private void createproject_Click(object sender, EventArgs e)
        {
            create_org.Show();
        }

        private void back_Click(object sender, EventArgs e)
        {
            message_org.Hide();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Do you really want to cancel creating the project?", "Yes", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                create_org.Hide();
            }
        }

        private void passproject_Click(object sender, EventArgs e)
        {
            //lagay na sa db for approval
            if (MessageBox.Show("Are you sure with this project details?", "Yes", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                MessageBox.Show("Project added! please wait for approval");
                create_org.Hide();
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            show_org.Hide();
            edit_org.Show();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you really done editing your account?", "Yes", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                //kunin laman nung mga txt box tapos lagay na sa db. preferably yung function call lang lalagay dito
                edit_org.Hide();
                show_org.Show();
            }
        }

        private void button6_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure deleting your account?", "Yes", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                //delete na yung account sa db. preferably yung function call lang lalagay dito
                MessageBox.Show("Account successfully deleted!");
                edit_org.Hide();
                show_org.Show();

                checker = 1;
                home.Show();
                this.Close();

                
            }
        }




        private void Organization_FormClosing(object sender, FormClosingEventArgs e)
        {

            if (checker == 0)
            {

                if (MessageBox.Show("Are you sure to close?", "Yes", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    home.Show();
                }
                else
                {
                    e.Cancel = true;
                }

            }
            
        }


    }
}
